Import jsonwrt code from util-linux
authorColin Walters <walters@verbum.org>
Thu, 26 Jun 2025 11:48:38 +0000 (07:48 -0400)
committerColin Walters <walters@verbum.org>
Thu, 26 Jun 2025 14:40:42 +0000 (10:40 -0400)
commit0a465f829af47a8f74aceb8121a8326b866af73a
treed59fee8a44823f8b446d68c490cd9a7cb118e0bf
parentfda45702d5bb68ce9abe3c301597ccf0e12bd0c8
Import jsonwrt code from util-linux

We've had a longstanding need to emit JSON to be friendlier
to shell scripting tools.

I hesitated for (way too long) on which JSON libraries to
use, but actually since we don't need to *parse* JSON,
we only need to omit it, the problem domain is super
simple.

util-linux has simple code for this
https://github.com/util-linux/util-linux/commit/b649ff92d2d91864e85a5bba4c89d52236817d9e

So this commit imports it, but it will need a little massaging
to build.

Signed-off-by: Colin Walters <walters@verbum.org>
Makefile-otutil.am
src/libotutil/ul-jsonwrt.c [new file with mode: 0644]
src/libotutil/ul-jsonwrt.h [new file with mode: 0644]